Moving-pixels procedure for digital picture edge-smoothing

ABSTRACT

Procedure for digital picture edge-smoothing refers to a method of smoothing the rough edges, around the objects, in a digital picture, as a result of enlargement. The procedure consists of detecting the rough edges and removing some pixel(s), so that edge will become smoother. If the edge has a 45 degrees angle, made of 2 by 2 pixels, will become an edge of 1 by 1 pixel. If the edge has 4 by 2 pixels, it will become a 2 by 1 pixel edge.

BACKGROUND OF THE INVENTION

[0001] This invention refers to a procedure of smoothing the rough edgesof a digital picture, by moving around the pixels resulting from pixelreplication enlargement.

[0002] The existing procedure uses a different color for pixels placedon the edges. The pixels are not moved, but only changed their color(their RGB value). The new color is an average of the neighboringpixels. Pixels could participate in different ratio to the new color.This is an edge-smoothing procedure, by different-color

[0003] The disadvantage of edge-smoothing procedure, by different-coloris a lost of contrast around the edges. The picture has blurred edgesand is not clear.

SUMMARY OF THE INVENTION

[0004] The object of this invention is a procedure to remove all thepixels placed in the farthest corner of the edge and replacing them withbackground pixels. As the picture is enlarged twice using pixelreplication, each pixel in the picture will be replaced with four equalsand arranged in a square. If these squares are placed next each other,horizontally or vertically, no rough edges will result. If they areplaced to form an inclined line (45 degrees or less) one pixel in eachsquare will be far from the line center. That pixel is a rough-edgepixel and that edge is a two-pixel edge. This edge will be visible andrough.

[0005] In order to smooth the edge, a computer procedure is necessary todetect the rough-edge pixels and move them in a right position or toreplace them with background pixel. This is an edge-smoothing procedure,by moving-pixels.

[0006] The advantage of this invention is a smooth edge and a highcontrast. All details will remain clear.

BRIEF DESCRIPTION OF THE DRAWINGS

[0007]FIG. 1a, shows a 2 by 2 picture edge, as result of enlargement, bypixel replication.

[0008]FIG. 1b, shows a 1 by 1 picture with edges smoothed bymoving-pixels procedure.

[0009]FIG. 2a, shows a 4 by 2 picture edge, as a result of enlargementby pixel replication.

[0010]FIG. 2b, shows a picture with edges smoothed by different-colorprocedure.

[0011]FIG. 2c, shows a 2 by 1 picture with edges smoothed bymoving-pixels procedure.

[0012]FIG. 3a, shows all the situations possible when the edge has to besmoothed.

[0013]FIG. 3b, shows all the situations with edges smoothed bymoving-pixels procedure.

[0014]FIG. 4a, shows a color picture enlarged by pixel replicationprocedure.

[0015]FIG. 4b, shows 4 a picture with edges smoothed by different-colorprocedure.

[0016]FIG. 4c, shows 4 a picture with edges smoothed by moving-pixelsprocedure.

[0017]FIG. 5a, shows a picture enlarged by pixel replication procedure.

[0018]FIG. 5b, shows 5 a picture with edges smoothed by different-colorprocedure.

[0019]FIG. 5c, shows 5 a picture with edges smoothed, by moving-pixelsprocedure.

[0020]FIG. 6a, shows a picture enlarged by pixel replication procedure.

[0021]FIG. 6b, shows 6 a picture with edges smoothed by different-colorprocedure.

[0022]FIG. 6c, shows 6 a picture with edges smoothed, by moving-pixelsprocedure.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENT

[0023] In FIG. 1a are 2 by 2 edges at 45 degrees. To smooth these edgeswe can replace the pixel “a” with “b” or “b” with “a”. To keep the sizeof the line the same, in one side are replaced “a” with “b” and in theother side “b” with “a”. The pixels “a” and “b” are just moved inanother position. Their RGB value is the same. The picture contrast andclarity will be the same. FIG. 1b is the edge smoothed by moving-pixelsprocedure.

[0024] The Prior-Art procedure to smooth the edges consists of combiningthe colors of “a” and “b” and placing them on both positions “a” and“b”. The “a” and “b” RGB color is an average of “a” and “b” RGB color.The new color of “a” and “b” is like (a+b)/2. This formula is appliedfor every R(red), G(green), B(blue) colors of the pixels “a” and “b”.

[0025] That color does not exist in the “a” and “b” neighborhood so theprocedure is called a different-color procedure. The “a” and “b” newcolor will be like a fog exactly on the edge. It will give a blurrededge, and will reduce the picture contrast. In practice much more than“a” and “b”. pixels will have the color changed. That will reduce theclarity of picture's details.

[0026] In FIG. 2a is an edge with 4 by 2 pixels. To smooth this edge,two “a” and two “b” has to be moved or changed colors. FIG. 2b shows the4 by 2 edge smoothed into 2 by 1 edge by moving-pixels procedure (theobject of this invention). FIG. 2c shows the 4 by 2 edge smoothed bydifferent-color procedure (the object of prior-art).

[0027] All possibilities of edges are shown in FIG. 3. Two for positiveslope (one above and one below), and two for negative slope (one aboveand one below). The FIG. 4 shows a picture enlarged by pixel replication(a), and smoothed by different-color (b) and moving-pixels procedure(c). FIG. 5 and FIG. 6 show pictures enlarged by pixel replication (a)and smoothed by different-color procedure (b), and by moving-pixelsprocedure (c).

[0028] Both these procedures are practically implemented by a computerprogramming, specific for different kinds of pictures.

[0029] In FIG. 7b, is a basic code for different-color procedure and inFIG. 7a is a basic code for moving-pixels procedure. The four pixelswhich forms a square are named: p(2,2), p(2,3), p(3,2) and p(3,3).Neighbors pixels are named p(1,1), p(1,2), p(1,3), p(1,4), p(2,1),p(2,4), p(3,1), p(3,4), p(4,1), p(4,2), p(4,3) and p(4,4).

[0030] The “if” statements in FIG. 7a, are designed to detect therough-edge pixels, and the next statement will move the pixels. Thereare four lines of code, one for each possibility. (as shows in FIG. 3a).

We claim:
 1. An edge-smoothing procedure, by moving-pixels, for digitalpicture edge-smoothing, consisting of computer's procedures to detectand move pixels, situated on the rough edges of an enlarged picture,without to change the pixel's RGB value, in the right position to get asmoother edge.